Cosmetic: Avoid explicit state variables
authorMatthias Clasen <mclasen@redhat.com>
Sat, 14 Nov 2015 15:30:16 +0000 (10:30 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 14 Nov 2015 17:32:57 +0000 (12:32 -0500)
Using the state of the context makes this more obviously correct.

gtk/gtktoolbar.c

index 57bfcb4dcb95603d240579e9ce39af9cd05f7d57..ccf7a480040667ba0564d8f84c1f0fa4b0326cec 100644 (file)
@@ -3575,7 +3575,6 @@ _gtk_toolbar_paint_space_line (GtkWidget           *widget,
 {
   GtkOrientation orientation;
   GtkStyleContext *context;
-  GtkStateFlags state;
   GtkBorder padding;
   gint width, height;
   const gdouble start_fraction = (SPACE_LINE_START / SPACE_LINE_DIVISION);
@@ -3585,11 +3584,11 @@ _gtk_toolbar_paint_space_line (GtkWidget           *widget,
 
   orientation = toolbar ? toolbar->priv->orientation : GTK_ORIENTATION_HORIZONTAL;
 
-  context = gtk_widget_get_style_context (widget);
-  state = gtk_widget_get_state_flags (widget);
   width = gtk_widget_get_allocated_width (widget);
   height = gtk_widget_get_allocated_height (widget);
-  gtk_style_context_get_padding (context, state, &padding);
+
+  context = gtk_widget_get_style_context (widget);
+  gtk_style_context_get_padding (context, gtk_style_context_get_state (context), &padding);
 
   if (orientation == GTK_ORIENTATION_HORIZONTAL)
     {